POV-Ray : Newsgroups : povray.newusers : Tips on code : Tips on code Server Time
30 Jul 2024 22:28:44 EDT (-0400)
  Tips on code  
From: Loek Peters
Date: 5 Aug 2003 08:32:13
Message: <3f2fa3cd$1@news.povray.org>
Hello all

Is there a way to optimize the code I have writen, or is this the shortes
way to this shape?

Thanx
Loek Peters

// begin
#include "colors.inc"
background { color Black }

camera  {
        location <0, 0, 10>
        look_at  <0, 0,  -1>
        }

light_source { <1, 3, 6> color White}

declare myTexture =
        texture {
                pigment { color rgb <0.56,0.35,0.30> }
                normal { bumps 0.7 scale 0.02 }
                finish {ambient 0.27 diffuse 0.8 phong 0.2}
                }
        }

declare rod = union {
        sphere {
                <0, 3, 2>, 0.5
                }
        sphere {
                <0, -3, 2>, 0.5
                }
        cylinder {
                <0, 3, 2>,
                <0, -3, 2>,
                0.5
                }
        texture { myTexture }
        }

difference {
        intersection{
                object { rod }
                box {
                <-0.6, -3.6,   1>,
                < 0.6, 3.6,  2>
                }
                texture { myTexture }
        }
                object {rod scale <-0.7, 0.954, 0>}
                object {rod scale <-0.1, 0.875, 1> translate <0,0,-0.5>}
  }
//end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.